// destructuringArray( [1,[2,4],3], "[a,[b],c]" );
// result
// { a:1, b:2, c:3 }
let a = [1,[52,4],3];
let b = "[a,[b],c]";
function destructuringArray(values,keys){
    
    try{

        let obj = {};
        if( typeof keys  === "string" ){
            keys = JSON.parse(keys.replace(/\w+/g,'"$&"'))
        }
        let interate = (values,keys) =>{
            keys.forEach((key,index) => {
                if( Array.isArray(key) ){
                    interate(values[index],key)
                }else{
                    obj[key] = values[index]
                }
            });
        }
        interate(values,keys)
        return obj;

    }catch(error){
        console.error("error")
    }
}


let newArr = [1,2,3,4];
console.log( null === null )

